package com.qa.service.impl;

import com.qa.clients.QuestionClient;
import com.qa.common.result.Result;
import com.qa.service.QuestionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class QuestionServiceImpl implements QuestionService {

    @Autowired
    private QuestionClient questionClient;

    /**
     * 删除该分类下的所有题目
     *
     * @param categoryId 分类id
     * @return Result
     */
    @Override
    public Result deleteQuestionsInCategory(Long categoryId) {
        log.info("deleteQuestionsInCategory:categoryId=" + categoryId);
        return questionClient.deleteAllQuestionsOfCategory(categoryId);
        // return Result.success();
    }
}
